package com.zy.controller;

import com.zy.entity.JsonResult;
import com.zy.entity.Post;
import com.zy.mapper.PostMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/app")
public class PostController {
    @Autowired
    PostMapper postMapper;

    /**
     * 获取所有职位
     *
     * @return com.zy.entity.JsonResult
     * @author 小宁
     * @date 2021-04-14 19:45
     */
    @ResponseBody
    @GetMapping("/getPostList")
    public JsonResult getPostList() {
        List<Post> postList = postMapper.selectList(null);
        return new JsonResult("200", "", postList);
    }

}
